import 'package:flutter/material.dart';

class MyRoomItem extends StatelessWidget {
  // final Channel data;
  final VoidCallback? onPressed;
  final Color backgroundColor;
  const MyRoomItem(
      {Key? key,
      this.onPressed,
      this.backgroundColor = const Color(0xFF2D2D2D)})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: () async {
        //TODO 待服务端返回正确的模板id
        // jumpToHallPage(
        //     context,
        //     data.channelId,
        //     data.hasPassword,
        //     data.owner.id.toInt() ==
        //         (UserManager.instance.currentUser?.id.toInt() ?? -1),
        //     joinSource: JoinSource.ROOM_LIST);
      },
      child: Ink(
        padding: EdgeInsets.zero,
        child: Container(
          margin: const EdgeInsets.only(left: 24, right: 24, top: 16),
          padding: const EdgeInsets.all(12),
          decoration: BoxDecoration(
            color: backgroundColor,
            borderRadius: BorderRadius.circular(16),
          ),
          child: Row(
            children: [
              // AvatarImage(
              //     url: data.icon, width: 80, height: 80, borderRadius: 8),
              const SizedBox(
                width: 10,
              ),
              Expanded(
                  child: Column(
                mainAxisSize: MainAxisSize.min,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Row(
                    children: [
                      const Expanded(
                        child: Text(
                          'data.title',
                          style: TextStyle(
                            color: Color(0xff333333),
                            fontSize: 15,
                            fontWeight: FontWeight.w500,
                          ),
                        ),
                      ),
                      Container(
                        width: 75,
                        height: 22,
                        decoration: BoxDecoration(
                            borderRadius: BorderRadius.circular(11),
                            color: const Color(0xFF424035)),
                        child: const Row(
                          children: [
                            // Container(
                            //     width: 22,
                            //     height: 22,
                            //     alignment: Alignment.center,
                            //     decoration: BoxDecoration(
                            //         borderRadius: BorderRadius.circular(11),
                            //         color: Color(0xff292821)),
                            //     child: AnimationAudioLinesWidget()),
                            Expanded(
                              child: Center(
                                child: Text(
                                  'data.roomLabelDesc',
                                  maxLines: 1,
                                  overflow: TextOverflow.ellipsis,
                                  style: TextStyle(
                                    color: Color(0xffffd400),
                                    fontSize: 11,
                                    fontWeight: FontWeight.w500,
                                  ),
                                ),
                              ),
                            ),
                            SizedBox(
                              width: 3,
                            ),
                          ],
                        ),
                      )
                    ],
                  ),
                  const SizedBox(
                    height: 2,
                  ),
                  const Text(
                    'data.theme',
                    style: TextStyle(
                      color: Color(0xff333333),
                      fontSize: 11,
                      fontWeight: FontWeight.w400,
                    ),
                  ),
                  const SizedBox(
                    height: 12,
                  ),
                  const Row(
                    children: [
                      // Expanded(
                      //     child: HorizontalAvatarImageGroup(
                      //   urlList: data.userList.map((e) => e.avatar).toList(),
                      //   width: 18,
                      //   height: 18,
                      //   borderRadius: 9,
                      //   border: Border.all(color: Color(0xffB9B8B4), width: 1),
                      //   margin: -3,
                      // )),
                      // AvatarImage(
                      //     url: "https://img0.baidu.com/it/u=4218825912,2348339408&fm=253&fmt=auto&app=138&f=JPEG?w=260&h=260",
                      //     width:22,
                      //     height:22,
                      //     borderRadius: 11),
                      Text(
                        'currentUserCount',
                        style: TextStyle(
                          color: Color(0xff333333),
                          fontSize: 11,
                          fontWeight: FontWeight.w400,
                        ),
                      ),
                    ],
                  )
                ],
              ))
            ],
          ),
        ),
      ),
    );
  }
}
